import { App } from "vue";
import useUserStore from "@/pinia/modules/user/userStore.ts";
const userStore = useUserStore();

export default {
  install(app: App) {
    app.directive("permissions", {
      mounted(el, binding) {
        const buttons = userStore.userInfo.buttons;
        if (!buttons.includes(binding.value)) {
          el.remove();
        }
      },
    });
  },
};
